import request from '@/utils/request'
import scope from './scope'
const apiPrefix = `${process.env.VUE_APP_BASE_API}/${scope}/project/`

// 项目管理
export const getProject = (params, config = {}) => {
  return request.get(apiPrefix + 'get', { params: params }, config)
}
export const getProjectListPage = (params, config = {}) => {
  params = params || {}
  return request.post(apiPrefix + 'getpage', params, config)
}
export const addProject = (params, config = {}) => {
  return request.post(apiPrefix + 'add', params, config)
}
export const editProject = (params, config = {}) => {
  return request.put(apiPrefix + 'update', params, config)
}
export const removeProject = (params, config = {}) => {
  return request.delete(apiPrefix + 'softdelete', { params: params }, config)
}
export const getTaskList = (params, config = {}) => {
  params = params || {}
  return request.post(apiPrefix + 'gettasklist', params, config)
}
export const getTaskItemList = (params, config = {}) => {
  params = params || {}
  return request.post(apiPrefix + 'gettaskitems', params, config)
}
export const addTaskItem = (params, config = {}) => {
  params = params || {}
  return request.post(apiPrefix + 'addtaskitem', params, config)
}
export const getTaskItem = (params, config = {}) => {
  return request.get(apiPrefix + 'gettaskitem', { params: params }, config)
}
export const initModule = (params, config = {}) => {
  params = params || {}
  return request.post(apiPrefix + 'initmodule', params, config)
}
export const getGanttData = (params, config = {}) => {
  params = params || {}
  return request.post(apiPrefix + 'getganttdata', params, config)
}
export const batchRemoveProject = (params, config = {}) => {
  return request.put(apiPrefix + 'BatchsoftDelete', params, config)
}
export const editTaskItem = (params, config = {}) => {
  return request.put(apiPrefix + 'updatetaskitem', params, config)
}
export const startProject = (params, config = {}) => {
  params = params || {}
  return request.post(apiPrefix + 'startproject', params, config)
}

